CREATE TABLE [dbo].[Location]
(
[Id] [int] NOT NULL,
[StreetLine1] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[StreetLine2] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[WardId] [int] NULL,
[DistrictId] [int] NULL,
[CityId] [int] NULL,
[Status] [int] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
GO
ALTER TABLE [dbo].[Location] ADD CONSTRAINT [PK_Location] PRIMARY KEY CLUSTERED  ([Id]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Location] ADD CONSTRAINT [FK_Location_City] FOREIGN KEY ([CityId]) REFERENCES [dbo].[City] ([Id])
GO
ALTER TABLE [dbo].[Location] ADD CONSTRAINT [FK_Location_District] FOREIGN KEY ([DistrictId]) REFERENCES [dbo].[District] ([Id])
GO
ALTER TABLE [dbo].[Location] ADD CONSTRAINT [FK_Location_Ward] FOREIGN KEY ([WardId]) REFERENCES [dbo].[Ward] ([Id])
GO
